<%--
  Created by IntelliJ IDEA.
  User: 喝假酒的ywj
  Date: 2020/3/8
  Time: 15:20
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html >
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>i movie</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/cinemaDetail.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery.cookie.js"></script>
    <script src="${pageContext.request.contextPath}/layer/layer.js"></script>
    <style>
        .footer{
            background-color: #262426;
            padding: 56px 0;
            min-width: 1200px;
            width: 100%;
            text-align: center;
        }
        .fix{
            position: fixed;
            bottom: 0;
            left: 0;
        }
    </style>
    <script>
        $(function () {
            let num = ${num}
            console.log(num);
            let userId = $.cookie("userId");
            console.log(userId)
           if(num===0){
               $('#footer').addClass('fix');
            }
            $('.buy-btn').click(function () {
                if(userId===undefined){
                    layer.msg("请先登录",function () {
                        window.location.href="${pageContext.request.contextPath}/front/index/login";
                    })
                }else {
                    let id = $(this).find('a').data('id');
                    window.location.href="${pageContext.request.contextPath}/front/cinema/select?id="+id;
                }
            })
        })
    </script>
</head>
<body>
<%@ include file="header.jsp"%>
<div class="cinema-detail-container">
    <div class="banner">
        <div class="wrapper">
            <div class="celeInfo-left">
                <div class="avatar-shadow">
                    <img class="avatar" src="${cinema.cover}" alt="唐人街探案3海报封面">
                </div>
            </div>
            <div class="celeInfo-right clearfix">
                <h1 class="name text-ellipsis">${cinema.name}</h1>
                <div class="address text-ellipsis">${cinema.address}</div>
                <div class="telphone">电话：${cinema.phone}</div>
            </div>
        </div>
    </div>
    <div class="main-container container">
        <div class="mod-title">
            <h2>今日场次</h2>
        </div>
        <div class="film-list">
            <c:forEach var="item" items="${list}">
                <div class="film-cell">
                    <div class="film-info">
                        <a href="" class="film-name">${item.movie_id.name}</a>
                        <p class="film-address">场次：${item.time}</p>
                    </div>
                    <div>
                        <div class="buy-btn">
                            <a href="javascript:void(0);" data-id="${item.id}">购票</a>
                        </div>
                        <div class="price">
                            <span class="rmb red">￥</span>
                            <span class="price-num red">${item.price}</span>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>
</div>
<div class="footer" id="footer">
    <!--底部-->
    <span>©2020 i movie电影</span>
</div>
</body>
</html>
